/*
 * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @Date: 2023-05-04 23:14:25
 * @LastEditors: zt 2993721164@qq.com
 * @LastEditTime: 2025-08-06 21:01:57
 * @FilePath: /yyshort-master/lib/common/routers/pages.dart
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import 'package:flutter/material.dart';
import 'package:yyshort/common/middlewares/middlewares.dart';
import 'package:get/get.dart';

import 'package:yyshort/pages/application/index.dart';
import 'package:yyshort/pages/category/index.dart';
import 'package:yyshort/pages/favorite_list/index.dart';
import 'package:yyshort/pages/frame/sign_in/index.dart';
import 'package:yyshort/pages/frame/sign_up/index.dart';
import 'package:yyshort/pages/frame/welcome/index.dart';
import 'package:yyshort/pages/home/index.dart';
import 'package:yyshort/pages/login/index.dart';
import 'package:yyshort/pages/payment/bindings.dart';
import 'package:yyshort/pages/payment/view.dart';
import 'package:yyshort/pages/personal/personal/index.dart';
import 'package:yyshort/pages/personal/record/index.dart';
import 'package:yyshort/pages/splash/index.dart';

import '../../pages/search_result/index.dart';
import 'routes.dart';

class AppPages {
  static const INITIAL = AppRoutes.INITIAL;
  static final RouteObserver<Route> observer = RouteObservers();
  static List<String> history = [];
  static const String preloadShortVideo = '/preload_short_video';

  static final List<GetPage> routes = [
    // 免登陆
    GetPage(
      name: AppRoutes.INITIAL,
      page: () => WelcomePage(),
      binding: WelcomeBinding(),
      middlewares: [RouteWelcomeMiddleware(priority: 0)],
    ),

    GetPage(
      name: AppRoutes.SIGN_IN,
      page: () => SignInPage(),
      binding: SignInBinding(),
    ),
    GetPage(
      name: AppRoutes.SIGN_UP,
      page: () => SignUpPage(),
      binding: SignUpBinding(),
    ),

    // 需要登录
    GetPage(
      name: AppRoutes.Application,
      page: () => ApplicationPage(),
      binding: ApplicationBinding(),
      // middlewares: [RouteAuthMiddleware(priority: 1)],
    ),

    // 分类列表
    GetPage(
      name: AppRoutes.Category,
      page: () => CategoryPage(),
      binding: CategoryBinding(),
    ),

    // 路由配置示例（在routes.dart中）
    GetPage(
      name: AppRoutes.Home,
      page: () => HomePage(),
      binding: HomeBinding(),
    ),

    GetPage(
      name: AppRoutes.Search_Result,
      page: () => SearchResultPage(),
      binding: SearchResultBinding(),
    ),

    GetPage(
      name: AppRoutes.Favorite_List,
      page: () => FavoriteListPage(),
      binding: FavoriteListBinding(),
    ),

    GetPage(
      name: AppRoutes.Personal,
      page: () => PersonalPage(),
      binding: PersonalBinding(),
    ),

    GetPage(
      name: AppRoutes.Payment,
      page: () => PaymentView(),
      binding: PaymentBindings(),
    ),

    GetPage(
      name: AppRoutes.YyLogin,
      page: () => LoginPage(),
      binding: LoginBinding(),
    ),

    GetPage(
      name: AppRoutes.Record,
      page: () => RecordPage(),
      binding: RecordBinding(),
    ),

    GetPage(
      name: AppRoutes.SplashScreen,
      page: () => SplashPage(),
      binding: SplashBinding(),
    ),
  ];

  // static final unknownRoute = GetPage(
  //   name: AppRoutes.NotFound,
  //   page: () => NotfoundView(),
  // );
}
